#include <iostream>
int m[300500]={1, 2, 0}, z[300500], l[20]={0, 1}, newL[20]={0, 1}, p[20]={1, 1}, newP[20] = {1, 1}, n = 2, newN = 2;
char s[300500];
void main() {
	gets(s + 1);
	for (int N = 2; s[N] != 0; N++) {
		for (int j = 0; j < n; j++) {
			int L = l[j] + 2, P = p[j];
			if (s[N] != s[N - L + 1 + P]) P = L - newL[newN - 1];
			if (s[N] != s[N - L + 1]) L -= P;
			if (L <= newL[newN - 1]) continue;
			if (P == newP[newN - 1] && newL[newN - 1] >= 2 * newP[newN - 1]) newL[newN - 1] = L;
			else newL[newN] = L, newP[newN] = P, newN++;
		}
		std::swap(newP, p), std::swap(newL, l), std::swap(newN, n), newN = 2;
		for (int j = 1; j < n; j++) {
			if (l[j] < 3 * p[j]) z[N - l[j]] = m[N - l[j]];
			m[N] |= (z[N - l[j]] |= m[N - p[j] - l[j] % p[j] ]) * 2;
		}
		printf("%d\n", (m[N] / 2) & ((1 << 31) - 1));
	}
}